import { Chapter } from '../model/Chapter.js'

const fn_list = async (ctx, next) => {
    const id = ctx.params.id
    let where ={
       courseId: id 
      }
    
    
    const chapter = await Chapter.findAll({where})
    ctx.body = {
      code: 1000,
      msg: '成功',
      data: chapter
    }
  }

export default [
    {
        method: 'get',
        url: '/chapter/:id',
        fn: fn_list
    }
]